package com.park.web.service.impl;

import com.park.web.base.baseOperation.BaseService;
import com.park.web.dao.wfProcessnodeMapper;
import com.park.web.model.domain.wfProcessnode;
import com.park.web.service.wfProcessnodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class wfProcessnodeServiceImpl extends BaseService<wfProcessnode> implements wfProcessnodeService {

    @Autowired
    wfProcessnodeMapper iwfProcessnodeMapper;

    public Integer deleteByFolwID(String flowId) {
        return iwfProcessnodeMapper.deleteByFolwID(flowId);
    }

    @Transactional
    public void saveOrUpdate(String flowId, List<wfProcessnode> list) {
        this.deleteByFolwID(flowId);
        this.batchSave(list);
    }
}